package api_day12;

public class Show extends Thread{
    @Override
    public void run() {
        synchronized (Picture.o){
            if (Picture.load){
                System.out.println("准备展示图片");
                try {
                    Thread.sleep(3000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                System.out.println("展示完成");
                Picture.show = true;
                Picture.o.notify();
            }else {
                try {
                    Picture.o.wait();
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        }
    }
}
